import request from '@/utils/request'

/**
 * 获取权限点列表
 * @returns
 */
export const getPermissonListApi = () => {
  return request({
    url: '/sys/permission',
    method: 'get'
  })
}

/**
 *新增权限点
 */
export const addPermissionAPi = (data) => {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

/**
 * 删除角色权限
 * @param {*} id
 * @returns
 */
export const delPermissionApi = (id) => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

/**
 *修改权限点详情
 * @param {*} id
 * @returns
 */
export const editPermissionAPi = (data) => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

/**
 * 获取权限点详情
 * @param {*} id
 * @returns
 */
export const getPermissionDetailApi = (id) => {
  return request({
    url: `/sys/permission/${id}`
  })
}
